<div class="c_body">
	<div class="u_tabs">
		<div class="u_tabs_head">
			<div class="u_tab curr" id="u_search_tab1">Мероприятия</div>
		</div>
	</div>
	<div class="tab" id="u_search_tab1_">	
		<div class="cat_head_members">
			<div class="cat_head_strip"></div>
			<?php // кнопка "Новая тема"
				if($checkAdmin) 
				{
					echo CHtml::link( 
						'<i>+</i>Добавить мероприятие',
						$this->createUrl('event/create',array('group'=>$_GET['group'])),
						array(
							'class'=>'green_btn r_m',
							'groupName'=>$groupName,
						)
					);
				}
			?>
			<div class="cat_head_h t">
				<p class="cat_head_h_txt">
					В сообществе <span><?php echo CHtml::encode(count( $model )); ?></span> мероприятий
				</p>
				<a class="cat_head_h_edit" href="<?php echo Yii::app()->createUrl('groups/view',array('group'=>$_GET['group']));?>">
					Назад к <?php echo CHtml::encode($groupName); ?>
				</a>
			</div>
		</div>
		<div class="clear"></div>

		<?php foreach ($model as $key => $event) : ?>
		<div class="f_list_item">
			<a href="<?php echo Yii::app()->createUrl('event/view', array('event'=>$event->id));?>" class="f_list_img">
				<?php //echo $this->material_image($event->id, $event->avatar, '100', 'events/'.$event->id); ?>
				<?php echo isset($event->avatar_info->name) ? $this->material_image(0, $event->avatar_info->name, '100', 'events/'. $event->id . '/' . 0) : $this->material_image(0, 'fuck', '100', 'events/'. $event->id . '/' . 0); ?>
			</a>
			<div class="f_list_txt no_l">
				<div class="f_list_name">
					<a href="<?php echo Yii::app()->createUrl('event/view', array('event'=>$event->id));?>">
						<?php echo CHtml::encode($event->name); ?>
					</a>
				</div>
				<div class="f_list_data">
					<p>Начало: <?php echo Yii::app()->dateFormatter->formatDateTime($event->begin, 'long','short'); ?></p>
					<p>Приглашает: 
						<a href="<?php echo Yii::app()->createUrl('groups/view', array('group'=>$_GET['group']));?>">
							<?php echo CHtml::encode($event->group->name); ?>
						</a>
					</p>
					<p><i><?php echo CHtml::encode($event->countSubscribers); ?></i> участников</p>
				</div>
			</div>
		</div>
		<?php endforeach; ?>
	</div>	
	<div class="clear"></div>
</div>